package com.lx.lottery.api.domain.validate;

import com.lx.lottery.api.application.IWxValidateService;
import com.lx.lottery.api.infrastructure.utils.sdk.SignatureUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

/**
 * 消息验证
 * @author lX
 * @version JDK 8
 * @className WxValidateServiceImpl (此处以class为例)
 * @date 2024/3/21
 * @description TODO
 */
@Service
public class WxValidateServiceImpl implements IWxValidateService {

    @Value("${wx.config.token}")
    private String token;


    @Override
    public boolean checkSign(String signature, String timestamp, String nonce) {
        return SignatureUtil.check(token, signature, timestamp, nonce);
    }
}
